/*
 * Copyright 2010 Mttang.com All right reserved. This software is the confidential and proprietary information of
 * Mttang.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the license agreement you entered into with Mttang.com.
 */
package com.mttang.util;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;

/**
 * 类PrvValidation.java的实现描述：TODO 类实现描述
 * 
 * @author 郑斌 2010-7-9 上午09:32:09
 */
public class PrvValidation {

    public static ModelAndView prv(HttpServletRequest request, String prv) {

        HttpSession session = request.getSession();
        Map<String, String> user = (Map) session.getAttribute("prv");
        String roleprv = user.get(prv);
        if ("true".equals(roleprv)) {
            return null;
        }
        return new ModelAndView(new RedirectView("prvError.do?method=prvError"), "bean", null);
    }

}
